import sys
sys.path.append('../base')
from base import Base
# 导入配置文件
import settings
# 登录页面的操作类，继承基类Base
class PageLogin(Base):
    # 输入用户名
    def page_input_username(self, username):
        self.base_input(settings.username, username)
    # 输入密码
    def page_input_password(self, pwd):
        self.base_input(settings.password, pwd)
    # 点击登录按钮
    def page_click_login_button(self):
        self.base_click(settings.login_btn)
    # 组装登录
    def page_login(self, username, pwd):
        self.page_input_username(username)
        self.page_input_password(pwd)
        self.page_click_login_button()
    # 获取结果
    def page_get_login_result(self):
        return self.base_get_text(settings.login_result)
if __name__ == '__main__':
    p1 = PageLogin()
    p1.page_login('admin', '888999')
    msg = p1.page_get_login_result()
    print('登录结果：', msg)
    p1.base_close()